package com.example.http.provider;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalTime;

@EnableDiscoveryClient
@SpringBootApplication
@RestController
public class HttpProvider2 {

    public static void main(String[] args) {
        SpringApplication.run(HttpProvider2.class, args);
    }

    /**
     * 为客户端提供可调用的接口
     */
    @RequestMapping("/call/{name}")
    public String call(@PathVariable String name) {
        return LocalTime.now() + "——服务提供者2：" + name;
    }
}
